using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace The_Last_Knights.GameScreen
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class Screen : VisibleGameEntity
    {
        protected string _id;

        public string Id
        {
            get { return _id; }            
        }

        protected Texture2D _background;
        public Screen(Game game, string ID, string background)
            : base(game)
        {
            _id = ID;
            if (background != null)
                _background = Game.Content.Load<Texture2D>(GameAssertPath.GUI_TEXTURE_PATH + background);
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization code here

            base.Initialize();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            // TODO: Add your update code here

            base.Update(gameTime);
        }



        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            SpriteBatch sb = ScreenManager.GetInstance().GetSpriteBatch();
            if (sb != null)
            {
                if (_background != null)
                {
                    sb.Begin();
                    sb.Draw(_background, new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height), Color.White);
                    sb.End();
                }
                    
            }
        }
    }
}
